# Generated by Django 2.2.12 on 2020-05-18 09:12

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("salary", "0007_auto_20200409_0249"),
    ]

    operations = [
        migrations.CreateModel(
            name="MonthlyCantonalValidation",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("date", models.DateField(verbose_name="Date (1er du mois)")),
                (
                    "canton",
                    models.CharField(
                        choices=[
                            ("AG", "Aargau"),
                            ("AR", "Appenzell Ausserrhoden"),
                            ("BS", "Basel-Stadt"),
                            ("BL", "Basel-Land"),
                            ("BE", "Berne"),
                            ("FR", "Fribourg"),
                            ("GE", "Geneva"),
                            ("GR", "Graubuenden"),
                            ("JU", "Jura"),
                            ("LU", "Lucerne"),
                            ("NE", "Neuchatel"),
                            ("SO", "Solothurn"),
                            ("SG", "St. Gallen"),
                            ("VS", "Valais"),
                            ("VD", "Vaud"),
                            ("ZH", "Zurich"),
                            ("WS", "Haut-Valais"),
                        ],
                        max_length=2,
                        unique_for_month="date",
                        unique_for_year="date",
                        verbose_name="Canton",
                    ),
                ),
                ("validated_at", models.DateTimeField(blank=True, null=True)),
                (
                    "validated_by",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Validation mensuelle cantonale",
                "verbose_name_plural": "Validations mensuelles cantonales",
                "ordering": ["date", "canton"],
                "unique_together": {("canton", "date")},
            },
        ),
    ]
